package com.souku.finance.application.base;

import android.os.Bundle;
import android.view.View;
import android.view.Window;

import com.souku.finance.application.R;
import com.souku.finance.application.widget.titlebar.BaseTitleBar;


/**
 * Created by Administrator on 2016/4/24.
 */
public abstract class BaseTitleBarActivity extends BaseActivity implements BaseTitleBar.OnClickTitleListener {

    public BaseTitleBar titleBar;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        requestWindowFeature(Window.FEATURE_NO_TITLE);
    }

    @Override
    public void setContentView(int layoutResID) {
        super.setContentView(layoutResID);
        titleBar = (BaseTitleBar) findViewById(R.id.title_bar);
        if (titleBar != null) {
            titleBar.setOnClickTitleListener(this);
        }
    }

    @Override
    public void onClickTitleLeftView(View v) {
        onBackPressed();
    }

    @Override
    public void onClickTitleRightView(View v) {

    }

    @Override
    public void onClickTitleCentreView(View v) {

    }

}
